package com.boco.blch.analysiser.compliance.HW.manager;

import com.boco.blch.analysiser.compliance.ComplianceResolved;

public class BOCO_Spark_LogAudit_LogRecordComplete implements ComplianceResolved{

	@Override
	public int realEchoResolved(String echoResult) {
		String[] echoResult1=echoResult.split("\n");
		if(echoResult != null && echoResult.trim().length() > 0){
			String rootCategory="";
			String file="";
			for(int i=0;i<echoResult1.length;i++){
				if(echoResult1[i].contains("log4j.rootCategory")){
					rootCategory=echoResult1[i];
				}
			}
			String[] rootCategory1=rootCategory.split(",");
			String value="log4j.appender."+rootCategory1[1].trim()+".File";
			System.out.println("目录为："+value);
			for(int i=0;i<echoResult1.length;i++){
				if(echoResult1[i].contains(value)){
					file=echoResult1[i];
				}
			}
			if(file.trim().length()>value.trim().length()){
				return SUCCESS;
			}
		}
		return FAILED;
	}
}
